34. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2020-08-14 00:01:30 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

34.1 Files compared

#LocationFileLast Modified
1Porto v3.2.3/Magento 2.x/Porto Theme/app/code/Mageplaza/LayeredNavigation/HelperData.php2018-10-10 20:33:20 +0000
2Porto v3.2.4/Magento 2.x/Porto Theme/app/code/Mageplaza/LayeredNavigation/HelperData.php2020-06-26 11:11:14 +0000

34.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged11144
Changed612
Inserted336
Removed110

34.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

34.4 Active regular expressions

No regular expressions were active.

34.5 Comparison detail

1 <?php 1 <?php
2 /** 2 /**
3  * Mageplaza 3  * Mageplaza
4  * 4  *
5  * NOTICE OF LICENSE 5  * NOTICE OF LICENSE
6  * 6  *
7  * This source file is subject to the Mageplaza.com license that is 7  * This source file is subject to the Mageplaza.com license that is
8  * available through the world-wide-web at this URL: 8  * available through the world-wide-web at this URL:
9  * https://www.mageplaza.com/LICENSE.txt 9  * https://www.mageplaza.com/LICENSE.txt
10  * 10  *
11  * DISCLAIMER 11  * DISCLAIMER
12  * 12  *
13  * Do not edit or add to this file if you wish to upgrade this extension to newer 13  * Do not edit or add to this file if you wish to upgrade this extension to newer
14  * version in the future. 14  * version in the future.
15  * 15  *
16  * @category    Mageplaza 16  * @category    Mageplaza
17  * @package     Mageplaza_LayeredNavigation 17  * @package     Mageplaza_LayeredNavigation
18  * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/) 18  * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
19  * @license     https://www.mageplaza.com/LICENSE.txt 19  * @license     https://www.mageplaza.com/LICENSE.txt
20  */ 20  */
21  21 
22 namespace Mageplaza\LayeredNavigation\Helper; 22 namespace Mageplaza\LayeredNavigation\Helper;
23  23 
    24 use Magento\Catalog\Model\Layer\Filter\FilterInterface;
    25 use Magento\Customer\Model\Session;
    26 use Magento\Framework\DataObject;
    27 use Magento\Framework\Exception\LocalizedException;
    28 use Magento\Framework\ObjectManagerInterface;
    29 use Magento\Store\Model\Store;
    30 use Mageplaza\LayeredNavigation\Model\Layer\Filter;
    31 
24 /** 32 /**
25  * Class Data 33  * Class Data
26  * @package Mageplaza\LayeredNavigation\Helper 34  * @package Mageplaza\LayeredNavigation\Helper
27  */ 35  */
28 class Data extends \Mageplaza\AjaxLayer\Helper\Data 36 class Data extends \Mageplaza\AjaxLayer\Helper\Data
29 { 37 {
30     const FILTER_TYPE_SLIDER = 'slider'; 38     const FILTER_TYPE_SLIDER = 'slider';
31     const FILTER_TYPE_LIST   = 'list'; 39     const FILTER_TYPE_LIST   = 'list';
32  40 
33     /** @var \Mageplaza\LayeredNavigation\Model\Layer\Filter */ 41     /** @var Filter */
34     protected $filterModel; 42     protected $filterModel;
35  43 
36     /** 44     /**
37      * @param null $storeId    
38      *    
39      * @return mixed    
40      */    
41     public function isEnabled($storeId = null)    
42     {    
43         return $this->getConfigGeneral('enable', $storeId) && $this->isModuleOutputEnabled();    
44     }    
45     
46     /**    
47      * @param $filters 45      * @param $filters
    46      *
48      * @return mixed 47      * @return mixed
49      */ 48      */
50     public function getLayerConfiguration($filters) 49     public function getLayerConfiguration($filters)
51     { 50     {
52         $filterParams = $this->_getRequest()->getParams(); 51         $filterParams = $this->_getRequest()->getParams();
53         foreach ($filterParams as $key => $param) { 52         foreach ($filterParams as $key => $param) {
54             $filterParams[$key] = htmlspecialchars($param); 53             $filterParams[$key] = htmlspecialchars($param);
55         } 54         }
56  55 
57         $config = new \Magento\Framework\DataObject([ 56         $config = new 
DataObject([
58             'active'             => array_keys($filterParams), 57             'active'             => array_keys($filterParams),
59             'params'             => $filterParams, 58             'params'             => $filterParams,
60             'isCustomerLoggedIn' => $this->objectManager->create('Magento\Customer\Model\Session')->isLoggedIn(), 59             'isCustomerLoggedIn' => $this->objectManager->create(
Session::class)->isLoggedIn(),
61             'isAjax'             => $this->ajaxEnabled() 60             'isAjax'             => $this->ajaxEnabled()
62         ]); 61         ]);
63  62 
64         $this->getFilterModel()->getLayerConfiguration($filters, $config); 63         $this->getFilterModel()->getLayerConfiguration($filters, $config);
65  64 
66         return self::jsonEncode($config->getData()); 65         return self::jsonEncode($config->getData());
67     } 66     }
68  67 
69     /** 68     /**
70      * @return \Mageplaza\LayeredNavigation\Model\Layer\Filter 69      * @return Filter
71      */ 70      */
72     public function getFilterModel() 71     public function getFilterModel()
73     { 72     {
74         if (!$this->filterModel) { 73         if (!$this->filterModel) {
75             $this->filterModel = $this->objectManager->create('Mageplaza\LayeredNavigation\Model\Layer\Filter'); 74             $this->filterModel = $this->objectManager->create(
Filter::class);
76         } 75         }
77  76 
78         return $this->filterModel; 77         return $this->filterModel;
79     } 78     }
80  79 
81     /** 80     /**
82      * @return \Magento\Framework\ObjectManagerInterface 81      * @return 
ObjectManagerInterface
83      */ 82      */
84     public function getObjectManager() 83     public function getObjectManager()
85     { 84     {
86         return $this->objectManager; 85         return $this->objectManager;
87     } 86     }
    87 
    88     /**
    89      * @param FilterInterface $filter
    90      * @param null $storeId
    91      *
    92      * @return string
    93      */
    94     public function getTooltipContent($filter, $storeId = null)
    95     {
    96         try {
    97             $store  = $this->storeManager->getStore($storeId);
    98             $labels = $filter->getAttributeModel()->getData('tooltip_content');
    99             if (isset($labels[$store->getId()])) {
    100                 if (empty($labels[$store->getId()])) {
    101                     return $labels[Store::DEFAULT_STORE_ID];
    102                 }
    103 
    104                 return $labels[$store->getId()];
    105             }
    106 
    107             return '';
    108         } catch (LocalizedException $e) {
    109             $this->_logger->error($e);
    110 
    111             return '';
    112         }
    113     }
88 } 114 }